
from fastapi import APIRouter,HTTPException
app = APIRouter()


@app.get('/login')
async def api() -> dict:
    return {'title': '登录接口'}


@app.get('/excp')
async def excp(name:str) -> dict:
    try:
       # print(exname)  测似异常
       print(name)
    except Exception as e:
        raise HTTPException(status_code=500,detail=str(e))

    return {'title': 'exp'}
